package com.jia.rpc.example.consumer;

import com.jia.rpc.example.common.UserService;
import com.jia.rpc.example.common.model.User;
import com.jia.rpc.proxy.ServiceProxyFactory;

public class EasyComsumerExample {
    public static void main(String[] args) {
        //
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("jiajia");

        //调用
        User newUser  = userService.getUser(user);
        if(newUser != null) {
            System.out.println(newUser.getName());
        }else{
            System.out.println("user == null");
        }
    }
}
